package org.lboot.flow.config;

import org.lboot.flow.config.impl.DefaultFlowControlConfig;
import org.lboot.flow.loader.TaskUserLoader;
import org.lboot.flow.loader.impl.DefaultTaskUserLoaderImpl;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @author kindear
 * 服务实现配置
 */
@SpringBootConfiguration
public class FlowServiceConfig {


    /**
     * 流程调度默认配置注入
     * @return
     */
    @Bean
    @ConditionalOnMissingBean(value = FlowControlConfig.class)
    public FlowControlConfig flowControlConfig(){
        return new DefaultFlowControlConfig();
    }


    /**
     * 流程任务用户加载
     * @return
     */
    @Bean
    @ConditionalOnMissingBean(value = TaskUserLoader.class)
    public TaskUserLoader taskUserLoader(){
        return new DefaultTaskUserLoaderImpl();
    }
}
